U.addLoad(async function () {
  
  let cDetail = $(".classDetail");
  let cid = location.search
  cid = qsToJson(cid).cid;
  let data = await myAjax({
    url: "http://localhost:3000/api/course",
    data: {
      cid,
    },
  });
  console.log(data);
  
  let course = data.result.result.courses
  let imgsrc = course.image_src;
  $("#img_detail").attr('src', imgsrc);
  let course_list = $('#course_list')
  let c_Str = ''
  c_Str += `<p class="title">${course.title}</p>
                <ul>
                    <li>年级科目：${course.grade_name}${course.subject_name}</li>
                    <li>地区：${course.area_name}</li>
                    <li>${course.intro}</li>
                    <li class="price">
                        <span>¥${course.price}</span>
                        <span>${course.status==1?'报名学习':'已过期'}</span>
                    </li>
                </ul>`;
  course_list.html(c_Str);


  let teacherData = data.result.result.teacher
  let t_introduce = $("#t_introduce");
  let t_Str = ''
  t_Str += `<p>授课师资</p>
            <div class="left">
                <p class="img">
                    <img src="${teacherData.head_photo_url}" alt="">
                </p>
                <p class="right"">
                    <span>${teacherData.realname}</span>
                    <span>小U课堂高级讲师</span>
                </p>

            </div>
            <div class="right"">
                ${teacherData.intro}
            </div>`;
  t_introduce.html(t_Str);
});
